<template>
  <div
    style="width: 220px; display: block; position: relative"
    :style="{
      height: height ? height : null,
      flex: height ? null : 'auto',
      'min-height': height ? null : '60px',
    }"
  >
    <div
      style="
        height: 100%;
        width: 3px;
        display: block;
        background: gray;
        position: absolute;
        top: 0;
        left: 108.5px;
      "
    ></div>
    <template v-if="showBtn">
      <el-popover
        placement="right"
        v-model="visible"
        style="margin-left: 50px; padding: 20px 5px"
      >
        <div class="btnGrp">
          <div
            @click="
              $emit('add', 3, '审核节点')
              visible = false
            "
            class="addStepBtn"
            style="100px"
          >
            <i class="el-icon-s-check" />
            审核
          </div>
          <div
            @click="
              $emit('add', 10, '抄送人')
              visible = false
            "
            class="addStepBtn"
            style="100px"
          >
            <i class="el-icon-s-promotion" />
            抄送
          </div>
          <div
            @click="
              $emit('add', 4, '分支节点')
              visible = false
            "
            class="addStepBtn"
            style="100px"
          >
            <i class="el-icon-guide" />
            分支
          </div>
        </div>

        <i
          class="btn el-icon-circle-plus"
          v-if="showBtn"
          slot="reference"
          style="font-size: 30px"
        ></i>
      </el-popover>
    </template>
  </div>
</template>
<script>
export default {
  props: ['height', 'showBtn'],
  data: function () {
    return {
      visible: false,
    }
  },
}
</script>
<style >
.btn {
  position: absolute;
  left: calc(50% - 15px);
  top: calc(50% - 15px);
  background: #f0f2f5;
  cursor: pointer;
}
.addStepBtn {
  width: 120px;
  height: 40px;
  cursor: pointer;
  line-height: 40px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  padding-left: 20px;
  font-size: 20px;
  border-radius: 5px;
}
.addStepBtn:hover {
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1); /*blur值为5px*/
}
.el-popover {
  padding: 10px 5px;
  height: 160px;
}
</style>